Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use argparse.REMAINDER to collect query arguments #17

Merged
merged 1 commit into from
Jan 9, 2013
Merged

Use argparse.REMAINDER to collect query arguments #17

merged 1 commit into from
Jan 9, 2013

Conversation

rraval
Copy link
Contributor

@rraval rraval commented Jan 9, 2013

Essentially, it prevents argparse from parsing arguments after the first positional argument (the query in this case).

Use Case:

$ howdoi undo rm -rf
git reset HEAD@{1}

Pre-patch error:

$ howdoi undo rm -rf
usage: howdoi [-h] [-p POS] [-a] [-l] QUERY [QUERY ...]
howdoi: error: unrecognized arguments: -rf

gleitz added a commit that referenced this pull request Jan 9, 2013
Use `argparse.REMAINDER` to collect query arguments
@gleitz gleitz merged commit b0cfa4d into gleitz:master Jan 9, 2013
@gleitz
Copy link
Owner

gleitz commented Jan 13, 2013

Sorry, I'm going to have to roll this back because it breaks queries like this:

howdoi format date bash -a (to get the full answer)
howdoi format date bash -l (to get the link)

If you can fix the code to notice when flags are passed I will add back the remainder functionality.

gleitz pushed a commit that referenced this pull request Jun 26, 2020
gleitz pushed a commit that referenced this pull request Apr 14, 2021
# This is the 1st commit message:

move from print_err to logging

# This is the commit message #2:

change sanity check message

# This is the commit message #3:

flake8 linting

# This is the commit message #4:

flake8 linting

# This is the commit message #5:

pylint updates

# This is the commit message #6:

pylint updates

# This is the commit message #7:

pylint updates for errors.py

# This is the commit message #8:

update changes from #344

# This is the commit message #9:

update formatting

# This is the commit message #10:

update formatting

# This is the commit message #11:

add consuructor to class

# This is the commit message #12:

refactor logging levels and messages

# This is the commit message #13:

refactor logging levels and messages

# This is the commit message #14:

pylint recomendations

# This is the commit message #15:

flake8 formating

# This is the commit message #16:

flake8 formating

# This is the commit message #17:

change logging to print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants